import { GlobalData } from "../Common/GlobalData";
import BaseSprite from "./BaseSprite";

const { ccclass, property } = cc._decorator;

@ccclass
export default class BaseLayer extends BaseSprite {

    @property({ type: cc.Node, tooltip: "top" })
    protected top: cc.Node = null;
    @property({ type: cc.Node, tooltip: "bottom" })
    protected bottom: cc.Node = null;

    protected onLoad() {
        super.onLoad();

        if (GlobalData.fixType == '宽适配') {
            if (this.top) {
                this.top.y = GlobalData.stage_height / 2;
            }
    
            if (this.bottom) {
                this.bottom.y = -GlobalData.stage_height / 2;
            } 
        }
    }
}